<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
</head>

<body>
  <script>

// es6 如何设置类 继承类 示例
    class Person{

      constructor(name,age) {
        this.name=name
        this.age=age
      }
      run(){
        console.log(this.name,'--run');
      }
    }


    const p1=new Person('张三',12)

    console.log(p1);

    p1.run()

    class Children extends Person{
      
      constructor(name,age,hahaha) {
        super(name,age)
        this.hahaha=hahaha
      }
      run(){
        super.run()
        console.log('子类额外run信息，chileren hahaha');
      }
    }


    const c1=new Children('小李',3,'hahaha')


    c1.run()

    console.log(c1);










  </script>
</body>

</html>